<template>
  <a-layout class="layout">
    <NavBar v-if="showNav"/>
    <a-layout-content>
      <router-view></router-view>
    </a-layout-content>
  </a-layout>
</template>

<script setup>
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import NavBar from './components/NavBar.vue'

const route = useRoute()

// 在登录页面不显示导航栏
const showNav = computed(() => route.name !== 'login')
</script>

<style>
.layout {
  min-height: 100vh;
}
</style>